<template>
  <div style="padding:10px">
    <div style="margin: 0 auto; text-align: center">
      <img
        src="/src/assets/home2.png"
        alt="logo"
        title="logo"
        style="height: 500px"
      />
    </div>
    <div style="margin: 0 auto; text-align: center">
      <div style="margin: 10px">
        <a-button type="primary" size="large" @click="goToPage">
          <template #icon>
            <PlusOutlined />
          </template>
          发布交易
        </a-button>
      </div>
    </div>
    <a-divider />
    <div style="margin: 0 auto; text-align: center">
      <a-typography-title :level="3">公告</a-typography-title>
    </div>
    <div style="padding: 10px">
      <a-table :columns="columns" :data-source="data"> </a-table>
    </div>
  </div>
</template>
<script>
import { ref, reactive, computed, nextTick, createVNode } from "vue";
import { useRouter } from "vue-router";
import { get, del, post, getBlob, put, tip, removeLocalToken } from "@/common";
import {
  PlusOutlined,
  DownloadOutlined,
  SmileOutlined,
  DownOutlined,
} from "@ant-design/icons-vue";
import { defineComponent } from "vue";
const columns = [
  {
    title: "标题",
    dataIndex: "title",
    key: "title",
  },

  {
    title: "发布时间",
    dataIndex: "create_at",
    key: "create_at",
  },
  {
    title: "内容",
    dataIndex: "content",
    key: "content",
  },
];
export default defineComponent({
  setup() {
    const data = ref();
    const getData = () => {
      get("/info/announcement").then((res) => {
        data.value = res.data;
      });
    };
    const router = useRouter();
    getData();
    const goToPage = () => {
      router.push({ path: "/home/releaseDeal" });
    };
    return {
      router,
      goToPage,
      getData,
      data,
      columns,
    };
  },

  components: {
    PlusOutlined,
    DownloadOutlined,
    SmileOutlined,
    DownOutlined,
  },
});
</script>
<style scoped>
.notice-top {
  display: flex;
}
.notice-top h1 {
  margin-left: 35%;
}
</style>
